package com.apps.sdses.flink141.test;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author jiwei
 * @description
 * @date 2023/8/25 10:41
 */
public class ObjectListToList {
    public static void main(String[] args) {
        LinkedList<MergedTargetField> fields = new LinkedList<>();
        fields.add(new MergedTargetField("col1"));
        fields.add(new MergedTargetField("col2"));
        fields.add(new MergedTargetField("col3"));
        fields.add(new MergedTargetField("col4"));


        List<String> collect = fields.stream().map(MergedTargetField::getFieldName).collect(Collectors.toList());

        for (String s : collect) {
            System.out.println("===============" + s);
        }

    }

    @Data
    @AllArgsConstructor
    static class MergedTargetField{
        public String fieldName;
    }
}
